<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Preprocessor Options (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Preprocessor Options (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Preprocessor Options (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Invoking-GCC.html" rel="up" title="Invoking GCC">
<link href="Assembler-Options.html" rel="next" title="Assembler Options">
<link href="Instrumentation-Options.html" rel="prev" title="Instrumentation Options">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
kbd.key {font-style: normal}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="section-level-extent" id="Preprocessor-Options">
<div class="nav-panel">
<p>
Next: <a href="Assembler-Options.html" accesskey="n" rel="next">Passing Options to the Assembler</a>, Previous: <a href="Instrumentation-Options.html" accesskey="p" rel="prev">Program Instrumentation Options</a>, Up: <a href="Invoking-GCC.html" accesskey="u" rel="up">GCC Command Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Options-Controlling-the-Preprocessor"><span>3.13 Options Controlling the Preprocessor<a class="copiable-link" href="#Options-Controlling-the-Preprocessor"> &para;</a></span></h3>
<a class="index-entry-id" id="index-preprocessor-options"></a>
<a class="index-entry-id" id="index-options_002c-preprocessor"></a>

<p>These options control the C preprocessor, which is run on each C source
file before actual compilation.
</p>
<p>If you use the <samp class="option">-E</samp> option, nothing is done except preprocessing.
Some of these options make sense only together with <samp class="option">-E</samp> because
they cause the preprocessor output to be unsuitable for actual
compilation.
</p>
<p>In addition to the options listed here, there are a number of options 
to control search paths for include files documented in 
<a class="ref" href="Directory-Options.html">Options for Directory Search</a>.  
Options to control preprocessor diagnostics are listed in 
<a class="ref" href="Warning-Options.html">Options to Request or Suppress Warnings</a>.
</p>
<dl class="table">
<dt><a id="index-D-1"></a><span><code class="code">-D <var class="var">name</var></code><a class="copiable-link" href="#index-D-1"> &para;</a></span></dt>
<dd><p>Predefine <var class="var">name</var> as a macro, with definition <code class="code">1</code>.
</p>
</dd>
<dt><code class="code">-D <var class="var">name</var>=<var class="var">definition</var></code></dt>
<dd><p>The contents of <var class="var">definition</var> are tokenized and processed as if
they appeared during translation phase three in a &lsquo;<samp class="samp">#define</samp>&rsquo;
directive.  In particular, the definition is truncated by
embedded newline characters.
</p>
<p>If you are invoking the preprocessor from a shell or shell-like
program you may need to use the shell&rsquo;s quoting syntax to protect
characters such as spaces that have a meaning in the shell syntax.
</p>
<p>If you wish to define a function-like macro on the command line, write
its argument list with surrounding parentheses before the equals sign
(if any).  Parentheses are meaningful to most shells, so you should
quote the option.  With <code class="command">sh</code> and <code class="command">csh</code>,
<samp class="option">-D'<var class="var">name</var>(<var class="var">args&hellip;</var>)=<var class="var">definition</var>'</samp> works.
</p>
<p><samp class="option">-D</samp> and <samp class="option">-U</samp> options are processed in the order they
are given on the command line.  All <samp class="option">-imacros <var class="var">file</var></samp> and
<samp class="option">-include <var class="var">file</var></samp> options are processed after all
<samp class="option">-D</samp> and <samp class="option">-U</samp> options.
</p>
</dd>
<dt><a id="index-U"></a><span><code class="code">-U <var class="var">name</var></code><a class="copiable-link" href="#index-U"> &para;</a></span></dt>
<dd><p>Cancel any previous definition of <var class="var">name</var>, either built in or
provided with a <samp class="option">-D</samp> option.
</p>
</dd>
<dt><a id="index-include"></a><span><code class="code">-include <var class="var">file</var></code><a class="copiable-link" href="#index-include"> &para;</a></span></dt>
<dd><p>Process <var class="var">file</var> as if <code class="code">#include &quot;file&quot;</code> appeared as the first
line of the primary source file.  However, the first directory searched
for <var class="var">file</var> is the preprocessor&rsquo;s working directory <em class="emph">instead of</em>
the directory containing the main source file.  If not found there, it
is searched for in the remainder of the <code class="code">#include &quot;&hellip;&quot;</code> search
chain as normal.
</p>
<p>If multiple <samp class="option">-include</samp> options are given, the files are included
in the order they appear on the command line.
</p>
</dd>
<dt><a id="index-imacros"></a><span><code class="code">-imacros <var class="var">file</var></code><a class="copiable-link" href="#index-imacros"> &para;</a></span></dt>
<dd><p>Exactly like <samp class="option">-include</samp>, except that any output produced by
scanning <var class="var">file</var> is thrown away.  Macros it defines remain defined.
This allows you to acquire all the macros from a header without also
processing its declarations.
</p>
<p>All files specified by <samp class="option">-imacros</samp> are processed before all files
specified by <samp class="option">-include</samp>.
</p>
</dd>
<dt><a id="index-undef"></a><span><code class="code">-undef</code><a class="copiable-link" href="#index-undef"> &para;</a></span></dt>
<dd><p>Do not predefine any system-specific or GCC-specific macros.  The
standard predefined macros remain defined.
</p>
</dd>
<dt><a id="index-pthread"></a><span><code class="code">-pthread</code><a class="copiable-link" href="#index-pthread"> &para;</a></span></dt>
<dd><p>Define additional macros required for using the POSIX threads library.
You should use this option consistently for both compilation and linking.
This option is supported on GNU/Linux targets, most other Unix derivatives,
and also on x86 Cygwin and MinGW targets.
</p>
</dd>
<dt><a class="index-entry-id" id="index-make"></a>
<a class="index-entry-id" id="index-dependencies_002c-make"></a>
<a id="index-M"></a><span><code class="code">-M</code><a class="copiable-link" href="#index-M"> &para;</a></span></dt>
<dd><p>Instead of outputting the result of preprocessing, output a rule
suitable for <code class="command">make</code> describing the dependencies of the main
source file.  The preprocessor outputs one <code class="command">make</code> rule containing
the object file name for that source file, a colon, and the names of all
the included files, including those coming from <samp class="option">-include</samp> or
<samp class="option">-imacros</samp> command-line options.
</p>
<p>Unless specified explicitly (with <samp class="option">-MT</samp> or <samp class="option">-MQ</samp>), the
object file name consists of the name of the source file with any
suffix replaced with object file suffix and with any leading directory
parts removed.  If there are many included files then the rule is
split into several lines using &lsquo;<samp class="samp">\</samp>&rsquo;-newline.  The rule has no
commands.
</p>
<p>This option does not suppress the preprocessor&rsquo;s debug output, such as
<samp class="option">-dM</samp>.  To avoid mixing such debug output with the dependency
rules you should explicitly specify the dependency output file with
<samp class="option">-MF</samp>, or use an environment variable like
<code class="env">DEPENDENCIES_OUTPUT</code> (see <a class="pxref" href="Environment-Variables.html">Environment Variables Affecting GCC</a>).  Debug output
is still sent to the regular output stream as normal.
</p>
<p>Passing <samp class="option">-M</samp> to the driver implies <samp class="option">-E</samp>, and suppresses
warnings with an implicit <samp class="option">-w</samp>.
</p>
</dd>
<dt><a id="index-MM"></a><span><code class="code">-MM</code><a class="copiable-link" href="#index-MM"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-M</samp> but do not mention header files that are found in
system header directories, nor header files that are included,
directly or indirectly, from such a header.
</p>
<p>This implies that the choice of angle brackets or double quotes in an
&lsquo;<samp class="samp">#include</samp>&rsquo; directive does not in itself determine whether that
header appears in <samp class="option">-MM</samp> dependency output.
</p>
<a class="anchor" id="dashMF"></a></dd>
<dt><a id="index-MF"></a><span><code class="code">-MF <var class="var">file</var></code><a class="copiable-link" href="#index-MF"> &para;</a></span></dt>
<dd><p>When used with <samp class="option">-M</samp> or <samp class="option">-MM</samp>, specifies a
file to write the dependencies to.  If no <samp class="option">-MF</samp> switch is given
the preprocessor sends the rules to the same place it would send
preprocessed output.
</p>
<p>When used with the driver options <samp class="option">-MD</samp> or <samp class="option">-MMD</samp>,
<samp class="option">-MF</samp> overrides the default dependency output file.
</p>
<p>If <var class="var">file</var> is <samp class="file">-</samp>, then the dependencies are written to <samp class="file">stdout</samp>.
</p>
</dd>
<dt><a id="index-MG"></a><span><code class="code">-MG</code><a class="copiable-link" href="#index-MG"> &para;</a></span></dt>
<dd><p>In conjunction with an option such as <samp class="option">-M</samp> requesting
dependency generation, <samp class="option">-MG</samp> assumes missing header files are
generated files and adds them to the dependency list without raising
an error.  The dependency filename is taken directly from the
<code class="code">#include</code> directive without prepending any path.  <samp class="option">-MG</samp>
also suppresses preprocessed output, as a missing header file renders
this useless.
</p>
<p>This feature is used in automatic updating of makefiles.
</p>
</dd>
<dt><a id="index-Mno_002dmodules"></a><span><code class="code">-Mno-modules</code><a class="copiable-link" href="#index-Mno_002dmodules"> &para;</a></span></dt>
<dd><p>Disable dependency generation for compiled module interfaces.
</p>
</dd>
<dt><a id="index-MP"></a><span><code class="code">-MP</code><a class="copiable-link" href="#index-MP"> &para;</a></span></dt>
<dd><p>This option instructs CPP to add a phony target for each dependency
other than the main file, causing each to depend on nothing.  These
dummy rules work around errors <code class="command">make</code> gives if you remove header
files without updating the <samp class="file">Makefile</samp> to match.
</p>
<p>This is typical output:
</p>
<div class="example smallexample">
<pre class="example-preformatted">test.o: test.c test.h

test.h:
</pre></div>

</dd>
<dt><a id="index-MT"></a><span><code class="code">-MT <var class="var">target</var></code><a class="copiable-link" href="#index-MT"> &para;</a></span></dt>
<dd>
<p>Change the target of the rule emitted by dependency generation.  By
default CPP takes the name of the main input file, deletes any
directory components and any file suffix such as &lsquo;<samp class="samp">.c</samp>&rsquo;, and
appends the platform&rsquo;s usual object suffix.  The result is the target.
</p>
<p>An <samp class="option">-MT</samp> option sets the target to be exactly the string you
specify.  If you want multiple targets, you can specify them as a single
argument to <samp class="option">-MT</samp>, or use multiple <samp class="option">-MT</samp> options.
</p>
<p>For example, <samp class="option">-MT&nbsp;'$(objpfx)foo.o'<!-- /@w --></samp> might give
</p>
<div class="example smallexample">
<pre class="example-preformatted">$(objpfx)foo.o: foo.c
</pre></div>

</dd>
<dt><a id="index-MQ"></a><span><code class="code">-MQ <var class="var">target</var></code><a class="copiable-link" href="#index-MQ"> &para;</a></span></dt>
<dd>
<p>Same as <samp class="option">-MT</samp>, but it quotes any characters which are special to
Make.  <samp class="option">-MQ&nbsp;'$(objpfx)foo.o'<!-- /@w --></samp> gives
</p>
<div class="example smallexample">
<pre class="example-preformatted">$$(objpfx)foo.o: foo.c
</pre></div>

<p>The default target is automatically quoted, as if it were given with
<samp class="option">-MQ</samp>.
</p>
</dd>
<dt><a id="index-MD"></a><span><code class="code">-MD</code><a class="copiable-link" href="#index-MD"> &para;</a></span></dt>
<dd><p><samp class="option">-MD</samp> is equivalent to <samp class="option">-M -MF <var class="var">file</var></samp>, except that
<samp class="option">-E</samp> is not implied.  The driver determines <var class="var">file</var> based on
whether an <samp class="option">-o</samp> option is given.  If it is, the driver uses its
argument but with a suffix of <samp class="file">.d</samp>, otherwise it takes the name
of the input file, removes any directory components and suffix, and
applies a <samp class="file">.d</samp> suffix.
</p>
<p>If <samp class="option">-MD</samp> is used in conjunction with <samp class="option">-E</samp>, any
<samp class="option">-o</samp> switch is understood to specify the dependency output file
(see <a class="pxref" href="#dashMF">-MF</a>), but if used without <samp class="option">-E</samp>, each <samp class="option">-o</samp>
is understood to specify a target object file.
</p>
<p>Since <samp class="option">-E</samp> is not implied, <samp class="option">-MD</samp> can be used to generate
a dependency output file as a side effect of the compilation process.
</p>
</dd>
<dt><a id="index-MMD"></a><span><code class="code">-MMD</code><a class="copiable-link" href="#index-MMD"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-MD</samp> except mention only user header files, not system
header files.
</p>
</dd>
<dt><a id="index-fpreprocessed"></a><span><code class="code">-fpreprocessed</code><a class="copiable-link" href="#index-fpreprocessed"> &para;</a></span></dt>
<dd><p>Indicate to the preprocessor that the input file has already been
preprocessed.  This suppresses things like macro expansion, trigraph
conversion, escaped newline splicing, and processing of most directives.
The preprocessor still recognizes and removes comments, so that you can
pass a file preprocessed with <samp class="option">-C</samp> to the compiler without
problems.  In this mode the integrated preprocessor is little more than
a tokenizer for the front ends.
</p>
<p><samp class="option">-fpreprocessed</samp> is implicit if the input file has one of the
extensions &lsquo;<samp class="samp">.i</samp>&rsquo;, &lsquo;<samp class="samp">.ii</samp>&rsquo; or &lsquo;<samp class="samp">.mi</samp>&rsquo;.  These are the
extensions that GCC uses for preprocessed files created by
<samp class="option">-save-temps</samp>.
</p>
</dd>
<dt><a id="index-fdirectives_002donly"></a><span><code class="code">-fdirectives-only</code><a class="copiable-link" href="#index-fdirectives_002donly"> &para;</a></span></dt>
<dd><p>When preprocessing, handle directives, but do not expand macros.
</p>
<p>The option&rsquo;s behavior depends on the <samp class="option">-E</samp> and <samp class="option">-fpreprocessed</samp>
options.
</p>
<p>With <samp class="option">-E</samp>, preprocessing is limited to the handling of directives
such as <code class="code">#define</code>, <code class="code">#ifdef</code>, and <code class="code">#error</code>.  Other
preprocessor operations, such as macro expansion and trigraph
conversion are not performed.  In addition, the <samp class="option">-dD</samp> option is
implicitly enabled.
</p>
<p>With <samp class="option">-fpreprocessed</samp>, predefinition of command line and most
builtin macros is disabled.  Macros such as <code class="code">__LINE__</code>, which are
contextually dependent, are handled normally.  This enables compilation of
files previously preprocessed with <code class="code">-E -fdirectives-only</code>.
</p>
<p>With both <samp class="option">-E</samp> and <samp class="option">-fpreprocessed</samp>, the rules for
<samp class="option">-fpreprocessed</samp> take precedence.  This enables full preprocessing of
files previously preprocessed with <code class="code">-E -fdirectives-only</code>.
</p>
</dd>
<dt><a id="index-fdollars_002din_002didentifiers"></a><span><code class="code">-fdollars-in-identifiers</code><a class="copiable-link" href="#index-fdollars_002din_002didentifiers"> &para;</a></span></dt>
<dd><a class="anchor" id="fdollars_002din_002didentifiers"></a><p>Accept &lsquo;<samp class="samp">$</samp>&rsquo; in identifiers.
</p>
</dd>
<dt><a id="index-fextended_002didentifiers"></a><span><code class="code">-fextended-identifiers</code><a class="copiable-link" href="#index-fextended_002didentifiers"> &para;</a></span></dt>
<dd><p>Accept universal character names and extended characters in
identifiers.  This option is enabled by default for C99 (and later C
standard versions) and C++.
</p>
</dd>
<dt><a id="index-fno_002dcanonical_002dsystem_002dheaders"></a><span><code class="code">-fno-canonical-system-headers</code><a class="copiable-link" href="#index-fno_002dcanonical_002dsystem_002dheaders"> &para;</a></span></dt>
<dd><p>When preprocessing, do not shorten system header paths with canonicalization.
</p>
</dd>
<dt><a id="index-fmax_002dinclude_002ddepth"></a><span><code class="code">-fmax-include-depth=<var class="var">depth</var></code><a class="copiable-link" href="#index-fmax_002dinclude_002ddepth"> &para;</a></span></dt>
<dd><p>Set the maximum depth of the nested #include. The default is 200. 
</p>
</dd>
<dt><a id="index-ftabstop"></a><span><code class="code">-ftabstop=<var class="var">width</var></code><a class="copiable-link" href="#index-ftabstop"> &para;</a></span></dt>
<dd><p>Set the distance between tab stops.  This helps the preprocessor report
correct column numbers in warnings or errors, even if tabs appear on the
line.  If the value is less than 1 or greater than 100, the option is
ignored.  The default is 8.
</p>
</dd>
<dt><a id="index-ftrack_002dmacro_002dexpansion"></a><span><code class="code">-ftrack-macro-expansion<span class="r">[</span>=<var class="var">level</var><span class="r">]</span></code><a class="copiable-link" href="#index-ftrack_002dmacro_002dexpansion"> &para;</a></span></dt>
<dd><p>Track locations of tokens across macro expansions. This allows the
compiler to emit diagnostic about the current macro expansion stack
when a compilation error occurs in a macro expansion. Using this
option makes the preprocessor and the compiler consume more
memory. The <var class="var">level</var> parameter can be used to choose the level of
precision of token location tracking thus decreasing the memory
consumption if necessary. Value &lsquo;<samp class="samp">0</samp>&rsquo; of <var class="var">level</var> de-activates
this option. Value &lsquo;<samp class="samp">1</samp>&rsquo; tracks tokens locations in a
degraded mode for the sake of minimal memory overhead. In this mode
all tokens resulting from the expansion of an argument of a
function-like macro have the same location. Value &lsquo;<samp class="samp">2</samp>&rsquo; tracks
tokens locations completely. This value is the most memory hungry.
When this option is given no argument, the default parameter value is
&lsquo;<samp class="samp">2</samp>&rsquo;.
</p>
<p>Note that <code class="code">-ftrack-macro-expansion=2</code> is activated by default.
</p>
</dd>
<dt><a id="index-fmacro_002dprefix_002dmap"></a><span><code class="code">-fmacro-prefix-map=<var class="var">old</var>=<var class="var">new</var></code><a class="copiable-link" href="#index-fmacro_002dprefix_002dmap"> &para;</a></span></dt>
<dd><p>When preprocessing files residing in directory <samp class="file"><var class="var">old</var></samp>,
expand the <code class="code">__FILE__</code> and <code class="code">__BASE_FILE__</code> macros as if the
files resided in directory <samp class="file"><var class="var">new</var></samp> instead.  This can be used
to change an absolute path to a relative path by using <samp class="file">.</samp> for
<var class="var">new</var> which can result in more reproducible builds that are
location independent.  This option also affects
<code class="code">__builtin_FILE()</code> during compilation.  See also
<samp class="option">-ffile-prefix-map</samp> and <samp class="option">-fcanon-prefix-map</samp>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-character-set_002c-execution"></a>
<a id="index-fexec_002dcharset"></a><span><code class="code">-fexec-charset=<var class="var">charset</var></code><a class="copiable-link" href="#index-fexec_002dcharset"> &para;</a></span></dt>
<dd><p>Set the execution character set, used for string and character
constants.  The default is UTF-8.  <var class="var">charset</var> can be any encoding
supported by the system&rsquo;s <code class="code">iconv</code> library routine.
</p>
</dd>
<dt><a class="index-entry-id" id="index-character-set_002c-wide-execution"></a>
<a id="index-fwide_002dexec_002dcharset"></a><span><code class="code">-fwide-exec-charset=<var class="var">charset</var></code><a class="copiable-link" href="#index-fwide_002dexec_002dcharset"> &para;</a></span></dt>
<dd><p>Set the wide execution character set, used for wide string and
character constants.  The default is one of UTF-32BE, UTF-32LE, UTF-16BE,
or UTF-16LE, whichever corresponds to the width of <code class="code">wchar_t</code> and the
big-endian or little-endian byte order being used for code generation.  As
with <samp class="option">-fexec-charset</samp>, <var class="var">charset</var> can be any encoding supported
by the system&rsquo;s <code class="code">iconv</code> library routine; however, you will have
problems with encodings that do not fit exactly in <code class="code">wchar_t</code>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-character-set_002c-input"></a>
<a id="index-finput_002dcharset"></a><span><code class="code">-finput-charset=<var class="var">charset</var></code><a class="copiable-link" href="#index-finput_002dcharset"> &para;</a></span></dt>
<dd><p>Set the input character set, used for translation from the character
set of the input file to the source character set used by GCC.  If the
locale does not specify, or GCC cannot get this information from the
locale, the default is UTF-8.  This can be overridden by either the locale
or this command-line option.  Currently the command-line option takes
precedence if there&rsquo;s a conflict.  <var class="var">charset</var> can be any encoding
supported by the system&rsquo;s <code class="code">iconv</code> library routine.
</p>
</dd>
<dt><a id="index-fpch_002ddeps"></a><span><code class="code">-fpch-deps</code><a class="copiable-link" href="#index-fpch_002ddeps"> &para;</a></span></dt>
<dd><p>When using precompiled headers (see <a class="pxref" href="Precompiled-Headers.html">Using Precompiled Headers</a>), this flag
causes the dependency-output flags to also list the files from the
precompiled header&rsquo;s dependencies.  If not specified, only the
precompiled header are listed and not the files that were used to
create it, because those files are not consulted when a precompiled
header is used.
</p>
</dd>
<dt><a id="index-fpch_002dpreprocess"></a><span><code class="code">-fpch-preprocess</code><a class="copiable-link" href="#index-fpch_002dpreprocess"> &para;</a></span></dt>
<dd><p>This option allows use of a precompiled header (see <a class="pxref" href="Precompiled-Headers.html">Using Precompiled Headers</a>) together with <samp class="option">-E</samp>.  It inserts a special <code class="code">#pragma</code>,
<code class="code">#pragma GCC pch_preprocess &quot;<var class="var">filename</var>&quot;</code> in the output to mark
the place where the precompiled header was found, and its <var class="var">filename</var>.
When <samp class="option">-fpreprocessed</samp> is in use, GCC recognizes this <code class="code">#pragma</code>
and loads the PCH.
</p>
<p>This option is off by default, because the resulting preprocessed output
is only really suitable as input to GCC.  It is switched on by
<samp class="option">-save-temps</samp>.
</p>
<p>You should not write this <code class="code">#pragma</code> in your own code, but it is
safe to edit the filename if the PCH file is available in a different
location.  The filename may be absolute or it may be relative to GCC&rsquo;s
current directory.
</p>
</dd>
<dt><a class="index-entry-id" id="index-fno_002dworking_002ddirectory"></a>
<a id="index-fworking_002ddirectory"></a><span><code class="code">-fworking-directory</code><a class="copiable-link" href="#index-fworking_002ddirectory"> &para;</a></span></dt>
<dd><p>Enable generation of linemarkers in the preprocessor output that
let the compiler know the current working directory at the time of
preprocessing.  When this option is enabled, the preprocessor
emits, after the initial linemarker, a second linemarker with the
current working directory followed by two slashes.  GCC uses this
directory, when it&rsquo;s present in the preprocessed input, as the
directory emitted as the current working directory in some debugging
information formats.  This option is implicitly enabled if debugging
information is enabled, but this can be inhibited with the negated
form <samp class="option">-fno-working-directory</samp>.  If the <samp class="option">-P</samp> flag is
present in the command line, this option has no effect, since no
<code class="code">#line</code> directives are emitted whatsoever.
</p>
</dd>
<dt><a id="index-A"></a><span><code class="code">-A <var class="var">predicate</var>=<var class="var">answer</var></code><a class="copiable-link" href="#index-A"> &para;</a></span></dt>
<dd><p>Make an assertion with the predicate <var class="var">predicate</var> and answer
<var class="var">answer</var>.  This form is preferred to the older form <samp class="option">-A
<var class="var">predicate</var>(<var class="var">answer</var>)</samp>, which is still supported, because
it does not use shell special characters.
</p>
</dd>
<dt><code class="code">-A -<var class="var">predicate</var>=<var class="var">answer</var></code></dt>
<dd><p>Cancel an assertion with the predicate <var class="var">predicate</var> and answer
<var class="var">answer</var>.
</p>
</dd>
<dt><a id="index-C"></a><span><code class="code">-C</code><a class="copiable-link" href="#index-C"> &para;</a></span></dt>
<dd><p>Do not discard comments.  All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive.
</p>
<p>You should be prepared for side effects when using <samp class="option">-C</samp>; it
causes the preprocessor to treat comments as tokens in their own right.
For example, comments appearing at the start of what would be a
directive line have the effect of turning that line into an ordinary
source line, since the first token on the line is no longer a &lsquo;<samp class="samp">#</samp>&rsquo;.
</p>
</dd>
<dt><a id="index-CC"></a><span><code class="code">-CC</code><a class="copiable-link" href="#index-CC"> &para;</a></span></dt>
<dd><p>Do not discard comments, including during macro expansion.  This is
like <samp class="option">-C</samp>, except that comments contained within macros are
also passed through to the output file where the macro is expanded.
</p>
<p>In addition to the side effects of the <samp class="option">-C</samp> option, the
<samp class="option">-CC</samp> option causes all C++-style comments inside a macro
to be converted to C-style comments.  This is to prevent later use
of that macro from inadvertently commenting out the remainder of
the source line.
</p>
<p>The <samp class="option">-CC</samp> option is generally used to support lint comments.
</p>
</dd>
<dt><a id="index-P"></a><span><code class="code">-P</code><a class="copiable-link" href="#index-P"> &para;</a></span></dt>
<dd><p>Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that is
not C code, and will be sent to a program which might be confused by the
linemarkers.
</p>
</dd>
<dt><a class="index-entry-id" id="index-C-language_002c-traditional"></a>
<a class="index-entry-id" id="index-traditional_002dcpp"></a>
<a class="index-entry-id" id="index-traditional"></a>
<a id="index-traditional-C-language"></a><span><code class="code">-traditional</code><a class="copiable-link" href="#index-traditional-C-language"> &para;</a></span></dt>
<dt><code class="code">-traditional-cpp</code></dt>
<dd>
<p>Try to imitate the behavior of pre-standard C preprocessors, as
opposed to ISO C preprocessors.
See the GNU CPP manual for details.
</p>
<p>Note that GCC does not otherwise attempt to emulate a pre-standard 
C compiler, and these options are only supported with the <samp class="option">-E</samp> 
switch, or when invoking CPP explicitly.
</p>
</dd>
<dt><a id="index-trigraphs"></a><span><code class="code">-trigraphs</code><a class="copiable-link" href="#index-trigraphs"> &para;</a></span></dt>
<dd><p>Support ISO C trigraphs.
These are three-character sequences, all starting with &lsquo;<samp class="samp">??</samp>&rsquo;, that
are defined by ISO C to stand for single characters.  For example,
&lsquo;<samp class="samp">??/</samp>&rsquo; stands for &lsquo;<samp class="samp">\</samp>&rsquo;, so &lsquo;<samp class="samp">'??/n'</samp>&rsquo; is a character
constant for a newline.
</p>
<p>The nine trigraphs and their replacements are
</p>
<div class="example smallexample">
<pre class="example-preformatted">Trigraph:       ??(  ??)  ??&lt;  ??&gt;  ??=  ??/  ??'  ??!  ??-
Replacement:      [    ]    {    }    #    \    ^    |    ~
</pre></div>

<p>By default, GCC ignores trigraphs, but in
standard-conforming modes it converts them.  See the <samp class="option">-std</samp> and
<samp class="option">-ansi</samp> options.
</p>
</dd>
<dt><a id="index-remap"></a><span><code class="code">-remap</code><a class="copiable-link" href="#index-remap"> &para;</a></span></dt>
<dd><p>Enable special code to work around file systems which only permit very
short file names, such as MS-DOS.
</p>
</dd>
<dt><a id="index-H"></a><span><code class="code">-H</code><a class="copiable-link" href="#index-H"> &para;</a></span></dt>
<dd><p>Print the name of each header file used, in addition to other normal
activities.  Each name is indented to show how deep in the
&lsquo;<samp class="samp">#include</samp>&rsquo; stack it is.  Precompiled header files are also
printed, even if they are found to be invalid; an invalid precompiled
header file is printed with &lsquo;<samp class="samp">...x</samp>&rsquo; and a valid one with &lsquo;<samp class="samp">...!</samp>&rsquo; .
</p>
</dd>
<dt><a id="index-d"></a><span><code class="code">-d<var class="var">letters</var></code><a class="copiable-link" href="#index-d"> &para;</a></span></dt>
<dd><p>Says to make debugging dumps during compilation as specified by
<var class="var">letters</var>.  The flags documented here are those relevant to the
preprocessor.  Other <var class="var">letters</var> are interpreted
by the compiler proper, or reserved for future versions of GCC, and so
are silently ignored.  If you specify <var class="var">letters</var> whose behavior
conflicts, the result is undefined.
See <a class="xref" href="Developer-Options.html">GCC Developer Options</a>, for more information.
</p>
<dl class="table">
<dt><a id="index-dM"></a><span><code class="code">-dM</code><a class="copiable-link" href="#index-dM"> &para;</a></span></dt>
<dd><p>Instead of the normal output, generate a list of &lsquo;<samp class="samp">#define</samp>&rsquo;
directives for all the macros defined during the execution of the
preprocessor, including predefined macros.  This gives you a way of
finding out what is predefined in your version of the preprocessor.
Assuming you have no file <samp class="file">foo.h</samp>, the command
</p>
<div class="example smallexample">
<pre class="example-preformatted">touch foo.h; cpp -dM foo.h
</pre></div>

<p>shows all the predefined macros.
</p>
<p>If you use <samp class="option">-dM</samp> without the <samp class="option">-E</samp> option, <samp class="option">-dM</samp> is
interpreted as a synonym for <samp class="option">-fdump-rtl-mach</samp>.
See <a data-manual="gcc" href="https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html#Developer-Options">(gcc)Developer Options</a>.
</p>
</dd>
<dt><a id="index-dD"></a><span><code class="code">-dD</code><a class="copiable-link" href="#index-dD"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-dM</samp> except in two respects: it does <em class="emph">not</em> include the
predefined macros, and it outputs <em class="emph">both</em> the &lsquo;<samp class="samp">#define</samp>&rsquo;
directives and the result of preprocessing.  Both kinds of output go to
the standard output file.
</p>
</dd>
<dt><a id="index-dN"></a><span><code class="code">-dN</code><a class="copiable-link" href="#index-dN"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-dD</samp>, but emit only the macro names, not their expansions.
</p>
</dd>
<dt><a id="index-dI"></a><span><code class="code">-dI</code><a class="copiable-link" href="#index-dI"> &para;</a></span></dt>
<dd><p>Output &lsquo;<samp class="samp">#include</samp>&rsquo; directives in addition to the result of
preprocessing.
</p>
</dd>
<dt><a id="index-dU"></a><span><code class="code">-dU</code><a class="copiable-link" href="#index-dU"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-dD</samp> except that only macros that are expanded, or whose
definedness is tested in preprocessor directives, are output; the
output is delayed until the use or test of the macro; and
&lsquo;<samp class="samp">#undef</samp>&rsquo; directives are also output for macros tested but
undefined at the time.
</p></dd>
</dl>

</dd>
<dt><a id="index-fdebug_002dcpp"></a><span><code class="code">-fdebug-cpp</code><a class="copiable-link" href="#index-fdebug_002dcpp"> &para;</a></span></dt>
<dd><p>This option is only useful for debugging GCC.  When used from CPP or with
<samp class="option">-E</samp>, it dumps debugging information about location maps.  Every
token in the output is preceded by the dump of the map its location
belongs to.
</p>
<p>When used from GCC without <samp class="option">-E</samp>, this option has no effect.
</p>
</dd>
<dt><a id="index-Wp"></a><span><code class="code">-Wp,<var class="var">option</var></code><a class="copiable-link" href="#index-Wp"> &para;</a></span></dt>
<dd><p>You can use <samp class="option">-Wp,<var class="var">option</var></samp> to bypass the compiler driver
and pass <var class="var">option</var> directly through to the preprocessor.  If
<var class="var">option</var> contains commas, it is split into multiple options at the
commas.  However, many options are modified, translated or interpreted
by the compiler driver before being passed to the preprocessor, and
<samp class="option">-Wp</samp> forcibly bypasses this phase.  The preprocessor&rsquo;s direct
interface is undocumented and subject to change, so whenever possible
you should avoid using <samp class="option">-Wp</samp> and let the driver handle the
options instead.
</p>
</dd>
<dt><a id="index-Xpreprocessor"></a><span><code class="code">-Xpreprocessor <var class="var">option</var></code><a class="copiable-link" href="#index-Xpreprocessor"> &para;</a></span></dt>
<dd><p>Pass <var class="var">option</var> as an option to the preprocessor.  You can use this to
supply system-specific preprocessor options that GCC does not 
recognize.
</p>
<p>If you want to pass an option that takes an argument, you must use
<samp class="option">-Xpreprocessor</samp> twice, once for the option and once for the argument.
</p>
</dd>
<dt><a id="index-no_002dintegrated_002dcpp"></a><span><code class="code">-no-integrated-cpp</code><a class="copiable-link" href="#index-no_002dintegrated_002dcpp"> &para;</a></span></dt>
<dd><p>Perform preprocessing as a separate pass before compilation.
By default, GCC performs preprocessing as an integrated part of
input tokenization and parsing.
If this option is provided, the appropriate language front end
(<code class="command">cc1</code>, <code class="command">cc1plus</code>, or <code class="command">cc1obj</code> for C, C++,
and Objective-C, respectively) is instead invoked twice,
once for preprocessing only and once for actual compilation
of the preprocessed input.
This option may be useful in conjunction with the <samp class="option">-B</samp> or
<samp class="option">-wrapper</samp> options to specify an alternate preprocessor or
perform additional processing of the program source between
normal preprocessing and compilation.
</p>
</dd>
<dt><a id="index-flarge_002dsource_002dfiles"></a><span><code class="code">-flarge-source-files</code><a class="copiable-link" href="#index-flarge_002dsource_002dfiles"> &para;</a></span></dt>
<dd><p>Adjust GCC to expect large source files, at the expense of slower
compilation and higher memory usage.
</p>
<p>Specifically, GCC normally tracks both column numbers and line numbers
within source files and it normally prints both of these numbers in
diagnostics.  However, once it has processed a certain number of source
lines, it stops tracking column numbers and only tracks line numbers.
This means that diagnostics for later lines do not include column numbers.
It also means that options like <samp class="option">-Wmisleading-indentation</samp> cease to work
at that point, although the compiler prints a note if this happens.
Passing <samp class="option">-flarge-source-files</samp> significantly increases the number
of source lines that GCC can process before it stops tracking columns.
</p>
</dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Assembler-Options.html">Passing Options to the Assembler</a>, Previous: <a href="Instrumentation-Options.html">Program Instrumentation Options</a>, Up: <a href="Invoking-GCC.html">GCC Command Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
